<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js对象string</title>
</head>
<body>

</body>
<script>
  var str = "   hello world   ";
  console.log(str)
  console.log(str.length);

  console.log(str.charAt(4));
  console.log(str.indexOf("lo"));

  let s = str.trim();
  console.log(s.length);

  console.log(s.substring(0, 5))
</script>
</html>